package com.library.web.sys_book.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.library.web.sys_book.pojo.BookVo;
import com.library.web.sys_book.pojo.ListParm;
import com.library.web.sys_book.pojo.SysBooks;
import com.library.web.sys_book.pojo.ExportVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysBooksMapper extends BaseMapper<SysBooks> {
    IPage<SysBooks> getList(Page<SysBooks> page, @Param("parm") ListParm parm);

    //减库存
    Integer subBook(@Param("bookId") Long bookId);

    //还书加库存
    int addBook(@Param("bookId") Long bookId);

    //热门图书
    List<BookVo> getHotBook();

    //周图书排行
    List<BookVo> getBookByWeek();

    //月图书排行
    List<BookVo> getBookByMonth();

    //导出图书
    List<ExportVo> exportBook();
}
